﻿<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.lang.reflect.*" %>
<%@ page  import="java.util.*"  %>
<%@ page  import="java.sql.*"  %>
<%@page import="object.Module"%>
<%@page import="manage.BugManage"%>

<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@include file="JS/session.jsp" %>
<link rel="StyleSheet" href="css/dtree.css" type="text/css" />
<script type="text/javascript" src="JS/for_dtree.js"></script>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查询bug</title>
<link href="css/foreground.css" rel="stylesheet" type="text/css" />
<%@ taglib uri="displaytag" prefix="display"%>

<jsp:scriptlet>
   pageContext.setAttribute("tableclass", "table_style");
</jsp:scriptlet>

</head>
  <script> 
function go(obj){ 
self.location=obj.options[obj.selectedIndex].value; 
return false; 
} 
</script> 
 <BODY id=css-zen-garden>
  <jsp:useBean id="procedure" scope="page" class="Procedure.UseProcedure"/>
 <DIV id=container>
<DIV id=intro>
<DIV id=quickSummary>
 <p class=p2>欢迎，<%=session.getAttribute("RealName") %>;<a href="login.jsp">退出</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="EditUser.jsp">修改资料</a>&nbsp;&nbsp;
    <%
     String level= null;
     level=(String)session.getAttribute("UserLevel");
     if(level!=null&&level.equals("0"))
     {
     %> 
      <a href="admin/AddGroup.jsp">进入后台</a>
      <%
       }
       %></p>
</DIV>
<DIV id=preamble>
</DIV></DIV>
<DIV id=supportingText>
  <DIV id=requirements>
<H3><SPAN>BUG信息列表</SPAN></H3>
 <%

String buguserid=(String)session.getAttribute("UserID");

if(buguserid!=null)
{int BugUserID=Integer.parseInt(buguserid);
ArrayList list = BugManage.getWholeBugList(BugUserID);
request.setAttribute("results", list);
 %> 
 
   <display:table name="results" pagesize="5"  class="table">
   
    <display:column property="BugID" title="BUG编号" href="BugInfo.jsp" paramId="BugID" paramProperty="BugID" />
   
    <display:column property="BugSeverity" title="严重级别" />
    
    <display:column property="BugTitle" title="bug标题" />
     <display:column property="BugStatus" title="Bug状态" />
    <display:column property="OpenedByName" title="由谁创建" />
  
     <display:column property="ResolvedByName" title="由谁解决" />
   
  <display:setProperty name="paging.banner.placement" value="bottom" />
    <display:setProperty name="paging.banner.all_items_found">
        <p align=center class="pagebanner">共{0}条{2}</p>
    </display:setProperty>
<display:setProperty name="paging.banner.some_items_found">
        <p align=center class="pagebanner">共{0}条{1}</p>
    </display:setProperty>
    <display:setProperty name="paging.banner.first">
  <div align=center class="pagelinks">
        [<a href="{1}">首页</a>/<a href="{2}">上一页</a>]
        {0}
        [<a href="{3}">下一页</a>/<a href="{4}">尾页</a>]
  </div>
    </display:setProperty>
 <display:setProperty name="paging.banner.full">
  <div align=center class="pagelinks">
        [<a href="{1}">首页</a>/<a href="{2}">上一页</a>]
        {0}
        [<a href="{3}">下一页</a>/<a href="{4}">尾页</a>]
  </div>
    </display:setProperty>
 <display:setProperty name="paging.banner.last">
  <div align=center class="pagelinks">
        [<a href="{1}">首页</a>/<a href="{2}">上一页</a>]
        {0}
        [<a href="{3}">下一页</a>/<a href="{4}">尾页</a>]
  </div>
    </display:setProperty>
 </display:table>
<%} %>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</DIV>
</DIV>
<DIV id=linkList>
<DIV id=linkList2>
<DIV id=lselect>
<H3 class=select></H3>
<UL>
   <li><a href="QueryBug.jsp?QueryMode=Whole"><span 
  class=accesskey>查看BUG</span></a> </li>
          <li><a href="AddBug.jsp"><span 
  class=accesskey>创建BUG</span></a> </li>
  </UL>
</DIV>
      <div id=larchives>
        <h3 class=archives><span></span></h3>
        <ul>
        <LI>
        <form id="Moudule" name="Mudule" method="post" action="">
          <select name="ProductList" class="treelist" id="ProcuctList" onchange="go(this)">
           <option value="0">维护项目</option>
          <%  
             String ID=(String)session.getAttribute("UserID");
           if (ID!=null)
             {
             int projectID=0;
            if(request.getParameter("projectID")!=null)
            { 
             projectID=Integer.parseInt(request.getParameter("projectID"));
            }
             int UserID=Integer.parseInt(ID);
             ResultSet rs=procedure.getProjectLists(UserID);
            while(rs.next())
          { String ProjectName=rs.getString("ProjectName");
            int ProjectID=rs.getInt("ProjectID");
            if(ProjectID==projectID)
            {
            %>
             <option value="MyBug.jsp?projectID=<%= ProjectID%>"  selected="selected"><%=ProjectName %></option>
            <% 
            }
           else
            {
           %> 
            <option value="MyBug.jsp?projectID=<%= ProjectID%>"><%=ProjectName %></option>
          <% 
            }
            }
            rs.close();
            }
          %>
          </select>
        </form>
      </LI>
      <li>
        <%    String jscode="";
	         String id=request.getParameter("projectID");
	         if(id!=null)
	         {
	          int ProjectID=Integer.parseInt(id);
	          int ModuleID;
	          ArrayList list=procedure.getModules(ProjectID);
	          if(list.size()>0)
	           {
	              for(int count=0;count<list.size();count++)
				   {		
					 Module module=(Module)list.get(count);
					 ModuleID=module.getModuleID();
					 String url="QueryBug.jsp?moduleID="+ModuleID;
						
						//jscode=jscode+"Tree["+ k +"]  = '"+ id +"|"+ pid +"|"+ name +"|"+ url +"';";
					 jscode=jscode+"d.add("+ module.getModuleID() +","+ module.getParentID() +",'"+ module.getModuleName() +"','"+ url +"');";
						
	               }
	           }
	           
	           
	           }
	         
         %>
    <div class="dtree">
         <script type="text/javascript">
		<!--

		d = new dTree('d');
		d.add(0,-1,'项目模块');//由于缺少数据库缺少pid=-1的记录这里手动添加一个。
		<%=jscode%>

		document.write(d);

		//-->
	</script>

</div>
            
      </li>
         
        </ul>
      </div>
<DIV id=lresources>
<H3 class=resources></H3>
<UL>
    <li><a href="QueryBug.jsp?QueryMode=AssignedTo"><span class=accesskey>指派给我的BUG</span></a> </li>
    <li><a href="QueryBug.jsp?QueryMode=Opened"><span class=accesskey>由我创建的BUG</span></a> </li>
  </UL>
</DIV></DIV></DIV></DIV></BODY>
</html>